package org.changs.game.android.data.db.model;


import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;

@Entity(nameInDb = "book_Page")
public class BookPage {

    @SerializedName("book_page_id")
    @Property(nameInDb = "book_page_id")
    @Id
    private String bookPageId;

    @SerializedName("book_page_number")
    @Property(nameInDb = "book_page_number")
    private int pageNum;//页码

    @SerializedName("book_audio_zh")
    @Property(nameInDb = "book_audio_zh")
    private String audioZh;//中文音频

    @SerializedName("book_audio_en")
    @Property(nameInDb = "book_audio_en")
    private String audioEn;//英文音频

    @SerializedName("book_audio_us")
    @Property(nameInDb = "book_audio_us")
    private String audioUs;//美式英文音频

    @SerializedName("book_audio_other")
    @Property(nameInDb = "book_audio_other")
    private String audioOther;//其他音频

    @SerializedName("book_id")
    @Property(nameInDb = "book_id")
    private String bookId;
    @ToOne(joinProperty = "bookId")
    private Book book;//关系表

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 1739409646)
    private transient BookPageDao myDao;
    @Generated(hash = 1720175354)
    public BookPage(String bookPageId, int pageNum, String audioZh, String audioEn,
            String audioUs, String audioOther, String bookId) {
        this.bookPageId = bookPageId;
        this.pageNum = pageNum;
        this.audioZh = audioZh;
        this.audioEn = audioEn;
        this.audioUs = audioUs;
        this.audioOther = audioOther;
        this.bookId = bookId;
    }
    @Generated(hash = 1578984411)
    public BookPage() {
    }
    public String getBookPageId() {
        return this.bookPageId;
    }
    public void setBookPageId(String bookPageId) {
        this.bookPageId = bookPageId;
    }
    public int getPageNum() {
        return this.pageNum;
    }
    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }
    public String getAudioZh() {
        return this.audioZh;
    }
    public void setAudioZh(String audioZh) {
        this.audioZh = audioZh;
    }
    public String getAudioEn() {
        return this.audioEn;
    }
    public void setAudioEn(String audioEn) {
        this.audioEn = audioEn;
    }
    public String getAudioUs() {
        return this.audioUs;
    }
    public void setAudioUs(String audioUs) {
        this.audioUs = audioUs;
    }
    public String getAudioOther() {
        return this.audioOther;
    }
    public void setAudioOther(String audioOther) {
        this.audioOther = audioOther;
    }
    public String getBookId() {
        return this.bookId;
    }
    public void setBookId(String bookId) {
        this.bookId = bookId;
    }
    @Generated(hash = 1195315420)
    private transient String book__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 44696668)
    public Book getBook() {
        String __key = this.bookId;
        if (book__resolvedKey == null || book__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            BookDao targetDao = daoSession.getBookDao();
            Book bookNew = targetDao.load(__key);
            synchronized (this) {
                book = bookNew;
                book__resolvedKey = __key;
            }
        }
        return book;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 831155272)
    public void setBook(Book book) {
        synchronized (this) {
            this.book = book;
            bookId = book == null ? null : book.getIsbn();
            book__resolvedKey = bookId;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 728834366)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getBookPageDao() : null;
    }

}
